<?php Yii::app()->clientScript->registerMetaTag($data['keywords'], 'keywords'); ?>
<?php Yii::app()->clientScript->registerMetaTag($data['title'], 'title'); ?>
<?php Yii::app()->clientScript->registerMetaTag($data['description'], 'description'); ?>

<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        mode : "textareas",
        theme : "advanced",
        skin : "default",
        width : "850",
        height : "210",
        invalid_elements: "img, a, script, h1, h2, h3, h4, h5, h6, h7, font, iframe, object",
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : false
    });
</script>

<div class="breadcrumb">
    <a href="<?php echo Yii::app()->createUrl('blog/default/index'); ?>">Блог</a>&nbsp;>
    <a href="<?php echo Yii::app()->createUrl('blog/default/cat', array('catUrl'=>$_GET['catUrl'])); ?>"><?php echo $data['catName']; ?></a>&nbsp;>
    <a href=""><?php echo $data['name']; ?></a>
</div><br/><br/>

<div class="well">
    <div style="text-align: center;">
        <a href="" style="text-decoration: underline; font-size: 18px; color:violet"><?php echo $data['name']; ?></a>
    </div>
    <br/><br/>
    <div style="text-align: justify;">
        <?php echo $data['text']; ?>
        <?php if($data['leaveCom']) : ?>
            <div style="text-align: center">
                <span style="margin-right: 30px;"><?php echo $data['countComments'] ? $data['countComments'] : 'Нет' ?> коментариев</span>
            </div>
        <?php endif; ?>
    </div>
</div>
<br/><br/>

<?php if($data['leaveCom']) : ?>
    <?php if(!empty($com)) : ?>
        <?php foreach ($com as $item) : ?>
            <div class="well">
                <a href="<?php echo Yii::app()->createUrl('user/profile/profile', array('login'=>$item['login'])); ?>"><?php echo $item['login']; ?></a>
                <span style="float: right"><?php echo Yii::app()->dateFormatter->format("dd MMMM yyyy года в HH:mm", $item['date']); ?></span>
                <br/><br/>
                <div style="text-align: justify;"><?php echo $item['text']; ?></div><br/>
            </div>    
        <?php endforeach; ?> 
    <?php else : ?>
        Сейчас нет комментариев. Вы можете быть первым:
    <?php endif; ?>
    <span>
        <?php echo CHtml::errorSummary($model); ?>
        <?php echo CHtml::beginForm(); ?>
        <?php echo CHtml::activeLabel($model, 'text'); ?>
        <?php echo CHtml::activeTextArea($model, 'text', array('style'=>'width:600px; height:150px')); ?>
        <?php echo CHtml::activeHiddenField($model, 'artId', array('value'=>$data['artId'])); ?>
        <?php echo CHtml::activeHiddenField($model, 'catId', array('value'=>$data['catId'])); ?>
        <br/>
        <?php echo CHtml::submitButton('Комментировать',array('class'=>'btn')); ?> 

        <?php echo CHtml::endForm(); ?>
    </span>    
<?php endif; ?>

        